/**
 * 
 */
package com.sysmanage.etl.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sysmanage.etl.dao.ErrorLogDao;
import com.sysmanage.etl.model.ETL_ErrorLog;
import com.sysmanage.etl.service.IErrorLogService;
import com.sysmanage.framework.dao.hspring.DAOInterface;
import com.sysmanage.framework.service.BaseService;

/**
 * @author Yu Jou
 * 2014年7月21日
 */
@Service("errorLogService")
@Transactional
public class ErrorLogServiceImpl extends BaseService<ETL_ErrorLog>  implements IErrorLogService {

	@Resource
	private ErrorLogDao errorLogDao;
	
	@Override
	protected DAOInterface<ETL_ErrorLog> getDAO() {
		return errorLogDao;
	}

	@Override
	public boolean processIgnoreAllErrors(Integer excelId , Integer status) {
		this.executeSql("update ETL_ErrorLog set status = " + status + " where excel_id = " + excelId);
//		List<ETL_ErrorLog> list = this.findList("from ETL_ErrorLog where excel.excel_id = " + excelId);
//		boolean isSuccess = false;
//		for (ETL_ErrorLog errorLog : list) {
//			errorLog.setStatus(2);
//			isSuccess = errorLogDao.alter(errorLog);
//		}
//		return isSuccess;
		return true;
	}

}
